******************************
* Table 2: Correlation between attrition and pre-treatment characteristics
* col 1, 2, 3
************************
clear all
set trace off
set more off
* Column 1
use "Jehanabad_analytic_sample_hemoglobin_attrition_extensive margin.dta"
g hindu=(hc_1_household_religon==1)
g base_hb=hemoglobin if hemoglobin!=.
xtile asset_tercile = asset_index, nq(3)
g bl_anemic=(base_hb < 11.5)
g dfemale=(sex_child==0)
g m_primary=(years_schooling_mother>5)
g f_primary=(years_schooling_father>5)
g family_size=(no_HHmembers> 7)

areg attrited treat treat##any_an treat##c.base_hb treat##dfemale treat##m_primary treat##hindu treat##family_size f_primary asset_tercile ///
total_enrollment class_size student_teacher_ratio, robust cluster(school_id) a(block)
est sto m1

*** p-value from joint F-statistics on the interactions  for col (1)
test c.base_hb#1.treat 1.treat#1.dfemale 1.treat#1.m_primary 1.treat#1.hindu 1.treat#1.family_size 1.treat#1.any_an


* Column 2
clear
use "Jehanabad_analytic_sample_cognition_attrition_extensive margin.dta"
g hindu=(hc_1_household_religon==1)
g base_hb=hemoglobin if hemoglobin!=.
xtile asset_tercile = asset_index, nq(3)
g bl_anemic=(base_hb < 11.5)
g dfemale=(sex_child==0)
g m_primary=(years_schooling_mother>5)
g f_primary=(years_schooling_father>5)
g family_size=(no_HHmembers> 7)

areg attrited treat treat##any_an treat##c.base_hb treat##dfemale treat##m_primary treat##hindu treat##family_size f_primary asset_tercile ///
total_enrollment class_size student_teacher_ratio, robust cluster(school_id) a(block)
est sto m2
*** p-value from joint F-statistics on the interactions  for col (2)
test c.base_hb#1.treat 1.treat#1.dfemale 1.treat#1.m_primary 1.treat#1.hindu 1.treat#1.family_size 1.treat#1.any_an


* Column 3
clear
use "Jehanabad_analytic_sample_attendance_attrition_extensive margin.dta", clear
g hindu=(hc_1_household_religon==1)
g base_hb=hemoglobin if hemoglobin!=.
xtile asset_tercile = asset_index, nq(3)
g bl_anemic=(base_hb < 11.5)
g dfemale=(sex_child==0)
g m_primary=(years_schooling_mother>5)
g f_primary=(years_schooling_father>5)
g family_size=(no_HHmembers> 7)

areg attrited treat treat##any_an treat##c.base_hb treat##dfemale treat##m_primary treat##hindu treat##family_size f_primary asset_tercile ///
total_enrollment class_size student_teacher_ratio, robust cluster(school_id) a(block)
est sto m3
*** p-value from joint F-statistics on the interactions  for col (3)
test c.base_hb#1.treat 1.treat#1.dfemale 1.treat#1.m_primary 1.treat#1.hindu 1.treat#1.family_size 1.treat#1.any_an


esttab m1 m2 m3 using Table2.rtf, se keep(treat base_hb 1.any_an 1.dfemale 1.m_primary 1.hindu 1.family_size  ///
1.treat#c.base_hb 1.treat#1.any_an 1.treat#1.dfemale 1.treat#1.m_primary 1.treat#1.hindu 1.treat#1.family_size) ///
b(3) se(3)  star(* 0.10 ** 0.05 *** 0.01) replace mtitle("Anemia  sample" "Cognition sample" "Attendance sample") ///
title("Table 2: Correlation between attrition and pre-treatment characteristics") ///
coeflabel(treat "Treatment" 1.any_an "Baseline anemic (hb<11.5)" base_hb "Baseline Hb levels" 1.treat#1.any_an "Treat* baseline anemic"  ///
1.dfemale "Female" 1.m_primary "Mother is primary schooled" 1.hindu "Hindu religion" 1.family_size "Above median family size"  ///
1.treat#c.base_hb "Treat * baseline Hb levels " 1.treat#1.dfemale "Treat * female" 1.treat#1.m_primary "Treat * mother is primary schooled"  ///
1.treat#1.hindu "Treat * Hindu" 1.treat#1.family_size "Treat * family size") ///
addnotes("Notes: Coefficients reported are from the Linear Probability Model. Robust standard errors clustered at school" ///
"levels are in parentheses.* and ** denote statistical significance at" "the 10% and 5% level. All models control" ///
"for asset tercile, total enrollment, class size, student-teacher ratio, and block fixed effects. Baseline anemic is a" ///
"dummy variable and coded as one for children with less than 11.5 Hb levels. Coefficients for these control" ///
"variables are not shown in the table but none of them are significant and are available upon request." ) 


close



